'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    // 插入搭配衣服关联数据
    await queryInterface.bulkInsert('outfit_items', [
      // 商务休闲搭配 (outfit_id: 1)
      {
        outfit_id: 1,
        clothing_id: 5, // 白色衬衫
        position: 'top',
        layer_order: 1,
        notes: '基础上装',
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        outfit_id: 1,
        clothing_id: 2, // 深蓝色直筒牛仔裤
        position: 'bottom',
        layer_order: 1,
        notes: '下装',
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        outfit_id: 1,
        clothing_id: 9, // 棕色皮鞋
        position: 'shoes',
        layer_order: 1,
        notes: '鞋子',
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        outfit_id: 1,
        clothing_id: 10, // 黑色手提包
        position: 'accessory',
        layer_order: 1,
        notes: '配饰',
        created_at: new Date(),
        updated_at: new Date(),
      },

      // 周末出游搭配 (outfit_id: 2)
      {
        outfit_id: 2,
        clothing_id: 1, // 白色基础T恤
        position: 'top',
        layer_order: 1,
        notes: '舒适上装',
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        outfit_id: 2,
        clothing_id: 2, // 深蓝色直筒牛仔裤
        position: 'bottom',
        layer_order: 1,
        notes: '休闲下装',
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        outfit_id: 2,
        clothing_id: 8, // 白色运动鞋
        position: 'shoes',
        layer_order: 1,
        notes: '舒适鞋子',
        created_at: new Date(),
        updated_at: new Date(),
      },

      // 正式场合搭配 (outfit_id: 3)
      {
        outfit_id: 3,
        clothing_id: 5, // 白色衬衫
        position: 'top',
        layer_order: 1,
        notes: '正式衬衫',
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        outfit_id: 3,
        clothing_id: 3, // 黑色西装外套
        position: 'outer',
        layer_order: 2,
        notes: '正式外套',
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        outfit_id: 3,
        clothing_id: 7, // 黑色休闲裤
        position: 'bottom',
        layer_order: 1,
        notes: '正式裤装',
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        outfit_id: 3,
        clothing_id: 9, // 棕色皮鞋
        position: 'shoes',
        layer_order: 1,
        notes: '正式鞋子',
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        outfit_id: 3,
        clothing_id: 10, // 黑色手提包
        position: 'accessory',
        layer_order: 1,
        notes: '商务包',
        created_at: new Date(),
        updated_at: new Date(),
      },

      // 运动休闲搭配 (outfit_id: 4)
      {
        outfit_id: 4,
        clothing_id: 1, // 白色基础T恤
        position: 'top',
        layer_order: 1,
        notes: '运动上装',
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        outfit_id: 4,
        clothing_id: 7, // 黑色休闲裤
        position: 'bottom',
        layer_order: 1,
        notes: '运动裤装',
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        outfit_id: 4,
        clothing_id: 8, // 白色运动鞋
        position: 'shoes',
        layer_order: 1,
        notes: '运动鞋',
        created_at: new Date(),
        updated_at: new Date(),
      },

      // 秋日温暖搭配 (outfit_id: 5)
      {
        outfit_id: 5,
        clothing_id: 4, // 灰色针织毛衣
        position: 'top',
        layer_order: 1,
        notes: '温暖毛衣',
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        outfit_id: 5,
        clothing_id: 6, // 米色风衣
        position: 'outer',
        layer_order: 2,
        notes: '秋季外套',
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        outfit_id: 5,
        clothing_id: 2, // 深蓝色直筒牛仔裤
        position: 'bottom',
        layer_order: 1,
        notes: '经典牛仔裤',
        created_at: new Date(),
        updated_at: new Date(),
      },
      {
        outfit_id: 5,
        clothing_id: 9, // 棕色皮鞋
        position: 'shoes',
        layer_order: 1,
        notes: '秋季鞋子',
        created_at: new Date(),
        updated_at: new Date(),
      },
    ]);
  },

  down: async (queryInterface, Sequelize) => {
    await queryInterface.bulkDelete('outfit_items', null, {});
  },
};
